package beautiful.butterfly.drds.data_exchange.constant;

import org.apache.commons.lang3.StringUtils;

import java.io.File;


public class Constants
{

    public static final String container_taskgroup_channel = "container.taskgroup.record_queue";

    public static final String container_model = "container.model";

    public static final String container_job_id = "container.job.id";

    public static final String container_trace_enable = "container.trace.enable";


    public static final String container_job_reportinterval = "container.job.reportinterval";

    public static final String container_job_sleepinterval = "container.job.sleepinterval";

    public static final String container_taskgroup_id = "container.taskgroup.id";

    public static final String container_taskgroup_sleepinterval = "container.taskgroup.sleepinterval";

    public static final String container_taskgroup_reportinterval = "container.taskgroup.reportinterval";

    public static final String container_task_failover_maxretrytimes = "container.task.failover.maxretrytimes";

    public static final String container_task_failover_retryintervalinmsec = "container.task.failover.retryintervalinmsec";

    public static final String container_task_failover_maxwaitinmsec = "container.task.failover.maxwaitinmsec";


    public static final String report_datax_perflog = "dataxserver.reportperflog";


    public static final String transport_channel_capacity = "data_exchange.record_queue.capacity";

    public static final String transport_channel_capacity_byte = "data_exchange.record_queue.bytecapacity";

    public static final String transport_channel_speed_byte = "data_exchange.record_queue.speed.byte";

    public static final String transport_channel_speed_record = "data_exchange.record_queue.speed.record";

    public static final String transport_channel_flowcontrolinterval = "data_exchange.record_queue.flowcontrolinterval";

    public static final String transport_exchanger_buffersize = "data_exchange.exchanger.buffersize";


    public static final String job_content_reader_name = "job.content[0].reade.name";

    public static final String job_content_reader_parameter = "job.content[0].reade.parameter";

    public static final String job_content_writer_name = "job.content[0].write.name";

    public static final String job_content_writer_parameter = "job.content[0].write.parameter";

    public static final String job_jobinfo = "job.jobinfo";

    public static final String task_list = "job.content";


    public static final String job_setting_speed_byte = "job.setting.speed.byte";

    public static final String job_setting_speed_record = "job.setting.speed.record";

    public static final String job_setting_speed_channel = "job.setting.speed.record_queue";


    public static final String job_setting_errorlimit_record = "job.setting.errorlimit.record";

    public static final String job_setting_errorlimit_percent = "job.setting.errorlimit.percentage";

    public static final String job_setting_dryrun = "job.setting.dryrun";

    public static final String job_prehandler_plugintype = "job.prehandler.plugintype";

    public static final String job_prehandler_pluginname = "job.prehandler.pluginname";

    public static final String job_posthandler_plugintype = "job.posthandler.plugintype";

    public static final String job_posthandler_pluginname = "job.posthandler.pluginname";
    // ----------------------------- 局部使用的变量
    public static final String job_writer = "reade";

    public static final String job_reader = "reade";

    public static final String job_transformer = "transformer";


    public static final String job_reader_parameter = "reade.parameter";


    public static final String job_writer_parameter = "write.parameter";


    public static final String task_id = "taskid";


    // ----------------------------- 环境变量 ---------------------------------

    public static String data_exchange_home = System.getProperty("datax.home");

    public static String data_exchange_conf_path = StringUtils.join(new String[]{
            data_exchange_home, "conf", "core.json"}, File.separator);


    public static String data_exchange_plugin_reader_home = StringUtils.join(
            new String[]{data_exchange_home, "plugin", "reade"}, File.separator);

    public static String data_exchange_plugin_writer_home = StringUtils.join(
            new String[]{data_exchange_home, "plugin", "write"}, File.separator);


    /**
     * 用于插件对自身 doBigIntegerSplit 的每个 task 标识其使用的资源，以告知core 对 reade/write doBigIntegerSplit 之后的 task 进行拼接时需要根据资源标签进行更有意义的 shuffle 操作
     */
    public static String load_balance_resource_mark = "load_balance_resource_mark";
}
